﻿//
// Position.cs
//
// Authors:
//    Claus Jørgensen <10229@iha.dk>
//    Jens Bloch Christensen <09584@iha.dk>
//    Jonas Daugaard Møller <08814@iha.dk>
//

namespace RSD.Robot
{
    /// <summary>
    /// Robot position structure, with mapped properties to the correct coordinate.
    /// </summary>
    public class Position
    {
        /// <summary>
        /// Axis rotations.
        /// </summary>
        private int[] enc = new int[USBC.TotalAxes];

        /// <summary>
        /// Bone joints.
        /// </summary>
        private int[] joint = new int[USBC.TotalAxes];

        /// <summary>
        /// XYZ coordinates.
        /// </summary>
        private int[] xyz = new int[USBC.TotalAxes];

        /// <summary>
        /// Gets or sets the axis rotations.
        /// </summary>
        public int[] Enc
        {
            get
            {
                return enc;
            }
            set
            {
                enc = value;
            }
        }

        /// <summary>
        /// Gets or sets the bone joints.
        /// </summary>
        public int[] Joint
        {
            get
            {
                return joint;
            }
            set
            {
                joint = value;
            }
        }

        /// <summary>
        /// Gets or sets the coordinate translation.
        /// </summary>
        public int[] XYZ
        {
            get
            {
                return xyz;
            }
            set
            {
                xyz = value;
            }
        }

        /// <summary>
        /// Gets or sets the position of the torso (XYZ[1])
        /// </summary>
        public int Torso
        {
            get
            {
                return XYZ[0];
            }
            set
            {
                XYZ[0] = value;
            }
        }

        /// <summary>
        /// Gets or sets the position of the shoulder (XYZ[0])
        /// </summary>
        public int Shoulder
        {
            get
            {
                return XYZ[1];
            }
            set
            {
                XYZ[1] = value;
            }
        }

        /// <summary>
        /// Gets or sets the position of the elbow (XYZ[2])
        /// </summary>
        public int Elbow
        {
            get
            {
                return XYZ[2];
            }
            set
            {
                XYZ[2] = value;
            }
        }

        /// <summary>
        /// Gets or sets the position of the pitch (XYZ[3])
        /// </summary>
        public int WristPitch
        {
            get
            {
                return XYZ[3];
            }
            set
            {
                XYZ[3] = value;
            }
        }

        /// <summary>
        /// Gets or sets the position of the roll (XYZ[4])
        /// </summary>
        public int WristRoll
        {
            get
            {
                return XYZ[4];
            }
            set
            {
                XYZ[4] = value;
            }
        }
    }
}
